<?php

namespace App\Kuafu\User\Controller\Outside;

use App\Exceptions\BaseException;
use App\Exceptions\CustomValidateException;
use App\Kuafu\Base\Controller\BaseController;
use App\Kuafu\User\Service\FsUserService;
use App\Kuafu\User\Validate\FsUserValidate;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class FsUserController extends BaseController
{

    /**
     * @param Request $request
     * @return JsonResponse
     * @throws BaseException
     * @throws CustomValidateException
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function notify(Request $request): JsonResponse
    {
        logMsg("飞书事件订阅日志", $request->all(), true, false);
        $params = FsUserValidate::notifyValidate($request->all());
        return $this->json(FsUserService::notify($params));
    }

}
